import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity({ name: "booksinfo", synchronize: false })
export class BooksEntity {

  /* 主键，使用自动增量值自增 */
  @PrimaryGeneratedColumn({ comment: "图书id" })
  id: number;

  @Column({ length: 255, comment: "书籍名称" })
  book_name: string;

  @Column({ length: 255, comment: "作者" })
  book_author: string;

  @Column({ type: "text", nullable: true, comment: "摘要" })
  book_abstract: string;

  @Column({ length: 255, nullable: true, comment: "分类" })
  book_type: string;

  @Column({ type: "json", nullable: true, comment: "标签" })
  book_label: object;

  @Column({ length: 255, nullable: true, comment: "图片地址" })
  book_image: string;

  @Column({ length: 255, nullable: true, comment: "图书链接" })
  book_link: string;

  @Column({ type: "float", nullable: true, comment: "评分" })
  book_score: number;


}
